package org.dylan.common.model;

import java.util.ArrayList;
import java.util.List;

import org.springframework.util.Assert;

/**
 * 数据查询请求，对查询的参数和排序封装组合
 * 
 * @author dylan
 * 
 */
public class QueryRequest {
	private List<QueryParam> params = new ArrayList<QueryParam>();
	private List<OrderBy> orders = new ArrayList<OrderBy>();

	public QueryRequest addParam(QueryParam param) {
		Assert.notNull(param);
		params.add(param);
		return this;
	}

	public QueryRequest addOrderBy(OrderBy orderBy) {
		Assert.notNull(orderBy);
		orders.add(orderBy);
		return this;
	}

	public List<QueryParam> params() {
		return this.params;
	}

	public List<OrderBy> orders() {
		return this.orders;
	}

}
